﻿define('ui/controller/permitActualController', 
	['local/cache', 'ui/controller/conditionController'], function(cache, conditionController) {

	/**
	 * 许可、实际排放量
	 */
	var permitActualController = {
		
		isnitialated: false,	
			
		initial: function(){
			//$("em.cl-air>span").first().text('空气指标');
			
			$("#myButton2").click(function(){
				conditionController.hideConditionList();
				
				var emissionML = require('ui/markerList/emissionML');
				emissionML.reRenderData();
			});
			
			if(cache.getPolluteData() == null) {
				cache.setPolluteData(polluteService.getPollutes());
				permitActualController.render(cache.getPolluteData());
			}
		},
		
		render: function(data) {
			for(var i=0; i<data.length; i++) {
				$("#permitAcutalPolluteCode").append("<option value='"+data[i].polluteCode+"'>"+data[i].polluteName+"</option >");
			}
			permitActualController.onSelect();
		},
		
		onSelect: function() {
			
			$('#permitAcutalPolluteCode').change(function(){
				
			});
		}
	};
	
	return permitActualController;
});